package com.example.demo.facade;

/**
 * @className: FacadePattern
 * @author: 芃
 * @description:
 * @date: 2024/12/23 17:52
 */
public class FacadePattern implements Light{
    private HallLight hallLight = new HallLight();
    private LivingLight livingLight = new LivingLight();
    private DiningLight diningLight = new DiningLight();


    @Override
    public void on() {
        //回家
        hallLight.on();
        livingLight.on();
        diningLight.on();
    }

    @Override
    public void off() {
        //离家
        diningLight.off();
        livingLight.off();
        hallLight.off();
    }
}
